﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Downloader
{
    public class DownloadTools
    {

        static string GetKbps(long bytes)
        {
            if (bytes < 1)
                return String.Empty;

            var speed = bytes / 1024.0;
            return String.Format("{0} kB", speed.ToString("0.00"));
        }

        static string GetMbps(long bytes)
        {
            if (bytes < 1)
                return String.Empty;

            var speed = bytes / 1024.0 / 1024.0;
            return String.Format("{0} Mb", speed.ToString("0.00"));
        }

        static string GetGbps(long bytes)
        {
            if (bytes < 1)
                return String.Empty;

            var speed = bytes / 1024.0 / 1024.0 / 1024.0;
            return String.Format("{0} Gb", speed.ToString("0.00"));
        }


    }
}
